package com.example.Service.impl;

import com.example.Service.SocialMemoService;
import com.example.entity.SocialMemo;
import com.example.mapper.SocialMemoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SocialMemoServiceImpl implements SocialMemoService {

    @Autowired
    private SocialMemoMapper socialMemoMapper;

    @Override
    public int addMemo(SocialMemo memo) {
        return socialMemoMapper.insertSocialMemo(memo);
    }

    @Override
    public int deleteMemoById(Integer memoId) {
        return socialMemoMapper.deleteSocialMemoById(memoId);
    }

    @Override
    public int updateMemo(SocialMemo memo) {
        return socialMemoMapper.updateSocialMemo(memo);
    }

    @Override
    public List<SocialMemo> getMemosByUserId(Integer userId) {
        return socialMemoMapper.getSocialMemosByUserId(userId);
    }
}
